package com.datastructure.test.maxletters;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;

public class MaxLetters {

    public static void main(String[] args) {

    }

    public int maxLetters (int[][] letters) {
        List<int[]> l = new ArrayList<>();
        for (int[] item : letters) {
            l.add(item);
        }
        return max(l);
    }

    public int max(List<int[]> list) {
        List<int[]> l = new ArrayList<>();
        for (int[] item : list) {
            for (int[] ints : list) {
                if ((item[0] > ints[0] && item[1] > ints[1])) {
                    l.add(item);
                    break;
                }
            }
        }
        if (l.size() != 0) {
            return 1 + max(l);
        }
        return 1;
    }
}

class Interval{
    public int left;
    public int right;

    public Interval() {
    }

    public Interval(int left, int right) {
        this.left = left;
        this.right = right;
    }
}
